﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using GU.WebERP.Dict;

namespace GU.WebERP.Model
{
    public class Model_Fct_OfficeBuildings : JnsFramework.Common.IModel
    {
        /// <summary>
        /// Description:  
        /// </summary>
        public int BId
        {
            get;
            set;
        }

        /// <summary>
        /// Description:1 : 市  2 : 区  3 : 办公楼   
        /// </summary>
        public int Grade
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string City
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string District
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string BuildingName
        {
            get;
            set;
        }

        /// <summary>
        /// Description:区和办公楼名的拼音首字母  
        /// </summary>
        public string PinYin
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string Address
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string BusinessArea
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public int ParentId
        {
            get;
            set;
        }

        /// <summary>
        /// Description:  
        /// </summary>
        public string Remark
        {
            get;
            set;
        }

        /// <summary>
        /// Description:是否已被删除  1：已删除   0 ：未删除  
        /// </summary>
        public int Disabled
        {
            get;
            set;
        }

        /// <summary>
        /// Description:创建时间  
        /// </summary>
        public DateTime Rec_CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// Description:创建人  
        /// </summary>
        public string Rec_CreateBy
        {
            get;
            set;
        }

        /// <summary>
        /// Description:修改时间  
        /// </summary>
        public DateTime Rec_ModifyTime
        {
            get;
            set;
        }

        /// <summary>
        /// Description:修改人  
        /// </summary>
        public string Rec_ModifyBy
        {
            get;
            set;
        }


        public static Model_Fct_OfficeBuildings TableToModel(DataTable dtWeiXin_Fct_OfficeBuildings)
        {
            if (dtWeiXin_Fct_OfficeBuildings != null && dtWeiXin_Fct_OfficeBuildings.Rows.Count > 0)
            {
                return TableRowToModel(dtWeiXin_Fct_OfficeBuildings.Rows[0]);
            }
            else
            {
                return null;
            }
        }


        public static Model_Fct_OfficeBuildings TableRowToModel(DataRow drWeiXin_Fct_OfficeBuildings)
        {
            Model_Fct_OfficeBuildings mWeiXin_Fct_OfficeBuildings = new Model_Fct_OfficeBuildings();
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BId] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BId].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.BId = Convert.ToInt32(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BId].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Grade] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Grade].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Grade = Convert.ToInt32(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Grade].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.City] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.City].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.City = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.City].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.District] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.District].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.District = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.District].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BuildingName] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BuildingName].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.BuildingName = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BuildingName].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.PinYin] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.PinYin].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.PinYin = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.PinYin].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Address] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Address].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Address = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Address].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BusinessArea] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BusinessArea].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.BusinessArea = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.BusinessArea].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.ParentId] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.ParentId].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.ParentId = Convert.ToInt32(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.ParentId].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Remark] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Remark].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Remark = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Remark].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Disabled] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Disabled].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Disabled = Convert.ToInt32(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Disabled].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateTime] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateTime].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Rec_CreateTime = Convert.ToDateTime(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateTime].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateBy] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateBy].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Rec_CreateBy = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_CreateBy].ToString();
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyTime] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyTime].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Rec_ModifyTime = Convert.ToDateTime(drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyTime].ToString());
            }
            if (drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyBy] != null && drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyBy].ToString() != "")
            {
                mWeiXin_Fct_OfficeBuildings.Rec_ModifyBy = drWeiXin_Fct_OfficeBuildings[Dict_WeiXin_Fct_OfficeBuildings.Rec_ModifyBy].ToString();
            }
            return mWeiXin_Fct_OfficeBuildings;
        }

        #region IModel 成员

        public string TableName
        {
            get { return "WeiXin_Fct_OfficeBuildings"; }
        }

        public string[] Columns
        {
            get { return new string[] { "BId", "Grade", "City", "District", "BuildingName", "PinYin", "Address", "BusinessArea", "ParentId", "Remark", "Disabled", "Rec_CreateTime", "Rec_CreateBy", "Rec_ModifyTime", "Rec_ModifyBy" }; }
        }

        #endregion
    }
}
